import { loadCSV } from './plugins/i18n'
import { Stage } from './stage'
import './style.css'
import { SgsEditor } from './uitls/sg-editor'

main()

async function init() {
    try {
        await loadCSV()
        new Stage(document.querySelector<HTMLDivElement>('#app')!)
        document.querySelector('.loading')?.remove()
    } catch (error) {
        console.error(error)
    }
}

async function main() {
    
    if (import.meta.env.MODE === 'vscode') {
        await SgsEditor.init()
    }
    await init()
    
}
